<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>字符配对算法</title>
	</head>
	<body>
		<script>
		function pair(str) {
			var bp={
				'G':'C',
				'C':'G',
				'A':'T',
				'T':'A'
			}
			var arr=[];
			for(var i=0;i<str.length;i++){
				var arr1=[];
				arr1.push(str[i]);
				arr1.push(bp[str[i]]);
				arr.push(arr1);
			}
		    return arr;
		}
		
		document.write(pair("GCG"));	
		</script>
	</body>
</html>
